Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Kernel to extract related code into Foundation classes #297

Merged
merged 58 commits into from
Jul 31, 2022

Conversation

caendesilva
Copy link
Member

@caendesilva caendesilva commented Jul 30, 2022

"When one class does the work of two, awkwardness results."

The goal of this experiment is to extract related code from the HydeKernel, without changing end usage. I'm doing this by creating new foundation classes, and redirecting method calls to them.

This is a rather weird pattern, but it separates logic by concerns, without changing the user experience, which I like.

If this is something that works out, each foundation class should have a test, and a contract (that both the class and the kernel implement)

@codecov
Copy link

codecov bot commented Jul 30, 2022

Codecov Report

Merging #297 (cea6cac) into master (a91c753) will not change coverage.
The diff coverage is 100.00%.

❗ Current head cea6cac differs from pull request most recent head 32ae9e0. Consider uploading reports for the commit 32ae9e0 to get more accurate results

@@             Coverage Diff             @@
##              master      #297   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity       815       831   +16     
===========================================
  Files             97        99    +2     
  Lines           2044      2078   +34     
===========================================
+ Hits            2044      2078   +34     
Impacted Files Coverage Δ
packages/framework/src/Foundation/Filesystem.php 100.00% <100.00%> (ø)
packages/framework/src/Foundation/Hyperlinks.php 100.00% <100.00%> (ø)
packages/framework/src/HydeKernel.php 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a91c753...32ae9e0. Read the comment docs.

@caendesilva
Copy link
Member Author

caendesilva commented Jul 30, 2022

Since all the tests are so scattered into unit tests it's hard to migrate all of them, so I expect there to be some mess as I can't really migrate everything right now. A lot of these are also very old from when I first started learning PHPUnit/Pest, and aren't that great to be honest.

Edit, at least some methods have links to the unit tests! Gonna make it a lot easier.

@caendesilva caendesilva changed the title Kernel refactor experiment to extract related code into foundation classes Refactor Kernel to extract related code into Foundation classes Jul 31, 2022
@caendesilva caendesilva marked this pull request as ready for review July 31, 2022 10:10
@caendesilva caendesilva merged commit 3d6eb64 into master Jul 31, 2022
@caendesilva caendesilva deleted the kernel-refactor-experiment branch July 31, 2022 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants